home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbfaqr01.zip
/
PCXREAD.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-08-10
|
2KB
|
61 lines
'From: BRENT ASHLEY
'Subj: PICTURES WITH QBASIC
'---------------------------------------------------------------------------
'Here's a PCX loader I found and played with some time ago. There are no
'comments and I'm not sure about converting to other screen modes, but
'it's a start and you're welcome to it. For speed, you'll want to either
'modify this to write to an invisible page and then make the page visible
'(apparent speed), or find a library with PCX routines (some of Tom
'Hanlin's have them) written in assembler.
DEFINT A-Z
DECLARE SUB PCXLOAD (File$)
CLS
PCXLOAD "MyFile.PCX"
WHILE INKEY$ = "": WEND
SUB PCXLOAD (File$) STATIC
SCREEN 11, , 0
OPEN File$ FOR INPUT AS #1 LEN = 16384
SEEK #1, 129
DEF SEG = &HA000
FOR ScrLin = 0 TO 479
Addr& = 80& * ScrLin
LinStrt& = Addr&: LinEnd& = Addr& + 80
Plane = 1
OUT &H3C4, 2: OUT &H3C5, Plane
DO WHILE Plane <= 8
Byte = ASC(INPUT$(1, 1))
IF EOF(1) THEN EXIT FOR
IF (Byte AND 192) <> 192 THEN
POKE Addr&, Byte
Addr& = Addr& + 1
IF Addr& >= LinEnd& THEN
Addr& = LinStrt&
Plane = Plane * 2
OUT &H3C4, 2: OUT &H3C5, Plane
END IF
ELSE
Byte = Byte AND 63
Byte2 = ASC(INPUT$(1, 1))
IF EOF(1) THEN EXIT FOR
FOR Expand = 1 TO Byte
POKE Addr&, Byte2
Addr& = Addr& + 1
IF Addr& >= LinEnd& THEN
Addr& = LinStrt&
Plane = Plane * 2
OUT &H3C4, 2: OUT &H3C5, Plane
END IF
NEXT
END IF
LOOP
NEXT
OUT &H3C4, 2: OUT &H3C5, &HF
DEF SEG
CLOSE #1
END SUB
' end of program